<?php

/**
 * Tomapeticion form base class.
 *
 * @method Tomapeticion getObject() Returns the current form's model object
 *
 * @package    KrazyTaxi
 * @subpackage form
 * @author     Your name here
 */
abstract class BaseTomapeticionForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'IDTOMA'        => new sfWidgetFormInputHidden(),
      'IDRUTA'        => new sfWidgetFormPropelChoice(array('model' => 'Peticion', 'add_empty' => true)),
      'PATENTETAXI'   => new sfWidgetFormPropelChoice(array('model' => 'Taxi', 'add_empty' => true)),
      'FECHAHORATOMA' => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'IDTOMA'        => new sfValidatorChoice(array('choices' => array($this->getObject()->getIdtoma()), 'empty_value' => $this->getObject()->getIdtoma(), 'required' => false)),
      'IDRUTA'        => new sfValidatorPropelChoice(array('model' => 'Peticion', 'column' => 'IDRUTA', 'required' => false)),
      'PATENTETAXI'   => new sfValidatorPropelChoice(array('model' => 'Taxi', 'column' => 'PATENTETAXI', 'required' => false)),
      'FECHAHORATOMA' => new sfValidatorDateTime(),
    ));

    $this->widgetSchema->setNameFormat('tomapeticion[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Tomapeticion';
  }


}
